package cn.lzd.mr.case7;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

/**
 * Created by lzd on 2018/6/5.
 */
public class GroupComparator extends WritableComparator {

    public GroupComparator() {
        super(Bean2.class,true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        System.out.println("====================================reduce分组开始-结束====================================");
        Bean2 bean1 = (Bean2) a;
        Bean2 bean2 = (Bean2) b;
        return bean1.getUserid().compareTo(bean2.getUserid());
    }
}
